<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>烟台市开锁业名录</title>
    <link type="text/css" href="<c:url value='/resource/wx/css/common.css'/>" rel="stylesheet"/>
    <style type="text/css">
        .main {
            font-size: 16px;

        }

        .main .form {
            height: 44px;
            line-height: 44px;
            border-top: 1px solid #dfdfdf;
            border-bottom: 1px solid #dfdfdf;
            width: 100%;
            float: left;
            background: #fff;

        }

        .main .form .label {
            height: 44px;
            line-height: 44px;
            color: #000;
            text-indent: 15px;
            float: left;
            width: 90px;
        }

        .main .form .element {
            height: 44px;
            line-height: 44px;
            margin-left: 100px;
            display: block;
        }

        .main .form .element input {
            color: #000;
            font-family: "微软雅黑", serif;

            border: 0;
            width: 90%;
            font-size: 1.0em;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }

        .main .btn:active {
            background-color: #3300ff;
            cursor: hand;
        }

        #result {
            min-height: 6em;
            margin: 0 10px;
            line-height: 2;

            color: #837D7D;
        }


        .ks_option{
            font-size: 1.0em;
            font-family: "微软雅黑", serif;
        }

        .main .uptop {
            margin-top: -1.6em;
        }

        .tab_title {
            height: 33px;
            border: 1px solid #157dfb;
            border-radius: 6px;
            background-color: #157dfb;
        }

        .tab_title .tab_item {
            width: 50%;
            display: inline-block;
            float: left;
            text-align: center;
            height: 33px;
            line-height: 33px;
            color: #706C6C;
            font-size: 1.6em;
            cursor: hand;
            background-color: #fff;
        }

        .tab_title .checked {
            background-color: transparent;
            color: #fff;
        }

        .tab_title .tab_left {
            border-top-left-radius: 5px;
            border-bottom-left-radius: 5px;
        }

        .tab_title .tab_right {
            border-top-right-radius: 5px;
            border-bottom-right-radius: 5px;
        }


        .title-bar .title {
            background-color: #17b4eb;
            -webkit-box-flex: 1;
            text-align: center;
            display: block;
        }

        .title-bar .btn-back {
            background-color: #17b4eb;
            border-top-left-radius: 0.7em;
            display: block;
            width: 3.0em;
            border-right: 1px solid rgba(197, 238, 220, 0.67);
        }

        .title-bar .btn-oper {
            border-top-right-radius: 0.7em;
            background-color: #17b4eb;
            display: block;
            width: 3.0em;
            text-align: center;
            width: -webkit-fit-content;
            min-width: 3.0em;
        }
    </style>
</head>
<body style="background: #f0f0f0;">
<div class="main">
    <div class="form searchbom border_top_radius boder-top">
        <span class="label">单位名称</span>
        <span class="element"><input id="name" class="no-border" type="text" placeholder="请输入单位名称"/></span>
    </div>
    <div class="form searchtop border_bottom_radius" style="margin-top: -1px;">
        <span class="label">所属区县</span>
        <span class="element">
            <select class="ks_option" onchange="" id="deptS">
              <option>请选择</option>
                 <c:forEach items="${region.data}" var="reg">
              <option value="${reg.guid}">${reg.regionname}</option>
                  </c:forEach>
            </select>
        </span>
    </div>
    <div style="float: left;width: 100%; padding:0px 15px;box-sizing: border-box">
        <button id="btn_query" onclick="clickT('1');" class="btn simple1 no-border" style="width: 100%">查 询</button>
    </div>
    <div id="result" >

    </div>
    <div id="toMore">

    </div>
</div>
<script type="text/javascript" src="<c:url value='/resource/wx/js/jquery-2.1.1.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/resource/wx/js/common.js'/>"></script>
<script type="text/javascript" src="https://gaapi.jl.gov.cn/logservice/resource/js/os.analystic-1.4.min.js"></script>
<script type="text/javascript">

    function mores(mpi) {

        clickT(mpi);

    }
    ;


    function clickT(pi) {
        var html = "";
        var name = $("#name").val().trim();
        var address = $("#deptS").find("option:selected").text();
        if(address=="请选择"){
            address="";
        }
//        else{
//            address=address.substring(0,2);
//        }
        console.log(address);
        $.ajax({
            url: "<c:url value='/weixin/wx_member/lockDetail'/>",
            type: "get",
            data: {"address": address, "name": name, "pi": pi},
            beforeSend: function () {
                loading("正在查询...");
            },
            success: function (data) {
                if (data.data.totalPage > 0) {
                    for (var i = 0; i < data.data.list.length; i++) {
                        html += "<div><font color='black'> 单位名称：</font>" + data.data.list[i].uname + "</div>";
                        html += "<div><font color='black'>经营地址：</font>" + data.data.list[i].address + "</div>";
                        html += "<div><font color='black'>所属区县：</font>" + data.data.list[i].area + "</div>";
                        html += "<div style='border-bottom:1px solid grey '><font color='black'>手机号码：</font>" + data.data.list[i].ephone + "</div>";
                    }
                    if (pi == 1) {
                        $("#result").html(html);
                    }else{
                        $("#result").append(html);
                    }
                    var morePi=data.data.pageIndex;
                    morePi++;
                    $("#result").show();
                    if (data.data.totalPage > pi) {
                        $("#toMore").html("<p style=' text-align:center;color: grey' onclick='mores("+morePi+");'>更多结果</p>");
                    }
                    finish();

                } else {
                    $("#result").html("");
                    finish("没有查询到相应的数据");
                }
            },
            error: function () {
                $("#result").hide();
                finish("查询失败");
            }
        });

    }
    ;


</script>
</body>
</html>
